<template> 
   <div class="qf_input">
    
    <input   type="text" v-focus :value="modelValue" :maxlength="maxlength"  @input="input" @change="inputChange"/>
   </div>
</template>

<script  setup lang="ts" name="qfInput">
    import {defineEmits} from 'vue';

    const props = defineProps({
        modelValue: String, // 定义v-model所需的props
        maxlength:Number||String
    }) 
    console.log(props)
     // emit
     const emit = defineEmits < {
        input: [value: any],
        change: [value: any]
    } > ();
    const input = (e) => {
        emit("input", e.target.value); 
    }
    const inputChange = (e) => {
        emit("change",e.target.value);
    }
</script>
<style lang="scss" scoped>
    @import url(./index.scss);
</style>
